#ifndef KITCHEN_HPP_
# define KITCHEN_HPP_

# include <vector>
# include "Cook.hpp"
# include "Utils/ISerializable.hpp"
# include "Communication/WalkieTalkie.hpp"
# include "Utils/macros.hpp"

namespace pizzeria {

/*! Represent a kitchen */
class Kitchen: public utils::ISerializable {
public:
  /*! Default constructor */
  Kitchen();
  /*! Constructor
   * \param walkieTalkie : the walkie talkie to use
   */
  Kitchen(communication::WalkieTalkie *walkieTalkie);
  /*! Destructor */
  ~Kitchen();

  /*! Serialize the object
   * \return a std::string representing the serialized data
   */
  std::string Serialize() const;
  /*! Deserialize the object
   * \param data : data to deserialize
   */
  void Deserialize(const std::string &data);
  /*! Get size of serialized data
   * \return size of serialized data
   */
  size_t GetSerializedSize() const;

  /*! Create a new kitchen
   * \param walkie : a pointer on the walkie talkie to use
   * \return NULL (pthread)
   */
  static void *CreateKitchen(void *walkieTalkie);

private:
  /*! Disallow copy constructor and assignment operator */
  DISALLOW_COPY_AND_ASSIGN(Kitchen);
  /*! Kitchen loop */
  void Loop();

  communication::WalkieTalkie *mWalkieTalkie; /*!< Linked with the reception */
  std::vector<Cook> mCooks; /*!< Cooks */
};

} /* !namespace pizzeria */
#endif /* !KITCHEN_HPP_ */
